# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=accountsservice
pkgver=22.08.8
pkgrel=0
pkgdesc="D-Bus interface for user account query and manipulation"
url="https://www.freedesktop.org/software/accountsservice/"
# s390x and riscv64 blocked by polkit
arch="all !s390x !riscv64"
license="GPL-3.0-or-later"
depends_dev="gobject-introspection-dev"
makedepends="
	$depends_dev
	elogind-dev
	glib-dev
	intltool
	meson
	polkit-dev
	vala
	"
subpackages="$pkgname-dev $pkgname-lang lib$pkgname:libs"
source="https://www.freedesktop.org/software/accountsservice/accountsservice-$pkgver.tar.xz
	musl-fgetspent_r.patch
	musl-wtmp.patch
	"

build() {
	abuild-meson \
		-Dsystemdsystemunitdir=no \
		-Delogind=true \
		-Dintrospection=true \
		-Ddocbook=false \
		-Dgtk_doc=false \
		-Dadmin_group=wheel \
		output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test -v --no-rebuild -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
2ca3ceb1b44338d9924b86788256d4eef7ec10e0c2197bfb8cc6c31ae224fab3051f03cb406a526f90057684965bef4ba0f2cc01b26198ec1fc6baec36ad3ff8  accountsservice-22.08.8.tar.xz
469392beca8f5941eafaa193c4fcb0472770ee4183ce520416a1b5d6abafe0e201990eb74d06bfbd9e20af08e55aff5f0031f267083f6c6879f0fe4e5028103c  musl-fgetspent_r.patch
054dc551808cfdb98a9876f1f24fee38c5aaf9686267cd7e871066caa8ec3029822e65549165a23222581319672c1ccb29213159c3b00804cf4119b89a7256ac  musl-wtmp.patch
"
